package net.loyintean.pearlshell.wechat.model;

import net.loyintean.pearlshell.wechat.common.MessageTypeEnum;

public class BaseMessageModel {

	private String toUserName;

	private String fromUserName;

	private int createTime;

	private MessageTypeEnum msgType;

	public BaseMessageModel() {
	}

	public BaseMessageModel(MessageTypeEnum t) {
		this.msgType = t;
	}

	public String asXml() {
		throw new RuntimeException("this method is not completed");
	}

	/**
	 * @return the toUserName
	 */
	public String getToUserName() {
		return toUserName;
	}

	/**
	 * @param toUserName
	 *            the toUserName to set
	 */
	public void setToUserName(String toUserName) {
		this.toUserName = toUserName;
	}

	/**
	 * @return the fromUserName
	 */
	public String getFromUserName() {
		return fromUserName;
	}

	/**
	 * @param fromUserName
	 *            the fromUserName to set
	 */
	public void setFromUserName(String fromUserName) {
		this.fromUserName = fromUserName;
	}

	/**
	 * @return the createTime
	 */
	public int getCreateTime() {
		return createTime;
	}

	/**
	 * @param createTime
	 *            the createTime to set
	 */
	public void setCreateTime(int createTime) {
		this.createTime = createTime;
	}

	/**
	 * @return the msgType
	 */
	public MessageTypeEnum getMsgType() {
		return msgType;
	}

	/**
	 * @param msgType
	 *            the msgType to set
	 */
	public void setMsgType(MessageTypeEnum msgType) {
		this.msgType = msgType;
	}

	/**
	 * 
	 * @author Loy-winters1224@163.com
	 * @see java.lang.Object#toString()
	 * 
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("BaseMessageModel [");
		if (toUserName != null) {
			builder.append("toUserName=");
			builder.append(toUserName);
			builder.append(", ");
		}
		if (fromUserName != null) {
			builder.append("fromUserName=");
			builder.append(fromUserName);
			builder.append(", ");
		}
		builder.append("createTime=");
		builder.append(createTime);
		builder.append(", ");
		if (msgType != null) {
			builder.append("msgType=");
			builder.append(msgType);
		}
		builder.append("]");
		return builder.toString();
	}
}
